function result = SubtractRows( matrix, r1, r2 )
%Subtracts r2 row from r1
k = matrix(r2, r1) / matrix(r1, r1);
if ~isnan(k)
    for i = 1 : size(matrix, 2)
        matrix(r2, i) = matrix(r2, i) - matrix(r1, i) * k;
    end;
end;
result = matrix;
end

